package com.bailong.administrator.ausedcar.ui.selltruckfragment;


import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.bailong.administrator.ausedcar.R;
import com.bailong.administrator.ausedcar.config.UrlConfig;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
//卖车碎片
public class SellTruckFragment extends Fragment {

    private View view;
    private Context mcontext;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mcontext = getActivity();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        //创建webview对象
        WebView webView =new WebView(mcontext);

        //设置属性,防止打开自带的浏览器
        webView.setWebViewClient(new WebViewClient());
        //让webview支持alert脚本
        webView.setWebChromeClient(new WebChromeClient());
        //获取webview对象的设置 设置他支持javascript
        webView.getSettings().setJavaScriptEnabled(true);
        //
        webView.loadUrl(UrlConfig.SELLTRUCK);
        return webView;
    }

}
